package com.bdqn.param.response;

import com.bdqn.entity.Dish;
import com.bdqn.entity.DishFlavor;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@NoArgsConstructor
@AllArgsConstructor
@Data
public class DishDto extends Dish {

    private List<DishFlavor> flavors;
    /**
     *菜品分类的名称 --->新增字段
     */
    private String categoryName;

    public DishDto(Dish dish, List<DishFlavor> dishFlavorList, String categoryName) {
        super.setId(dish.getId());
        super.setName(dish.getName());
        super.setPrice(dish.getPrice());
        super.setCategoryId(dish.getCategoryId());
        super.setStatus(dish.getStatus());
        super.setImage(dish.getImage());
        super.setDescription(dish.getDescription());
        super.setCreateUser(dish.getCreateUser());
        super.setSort(dish.getSort());
        super.setUpdateUser(dish.getUpdateUser());
        super.setCode(dish.getCode());
        super.setCreateTime(dish.getCreateTime());
        super.setUpdateTime(dish.getUpdateTime());
        this.flavors=dishFlavorList;
        this.categoryName=categoryName;
    }
}
